/**
 * Project 68th
 */


#ifndef _TCPSERVER_H
#define _TCPSERVER_H

#include "Acceptor.h"
#include "EventLoop.h"

using Callback = TcpConnectionCallback;

class TcpServer {
public: 

    /**
     * @param ip
     * @param port
     */
    TcpServer(const string& ip, unsigned short port);

    ~TcpServer();

    void start();

    void stop();

    /**
     * @param cb1
     * @param cb2
     * @param cb3
     */
    void setAllCallback(Callback && cb1, Callback && cb2, Callback && cb3);
private: 
    Acceptor _acceptor;
    EventLoop _loop;
};

#endif //_TCPSERVER_H
